package cn.tedu.zx.pojo.order.dto;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@Accessors(chain = true)
@TableName("booking")
public class BookingUpdateDto implements Serializable {

    @NotNull(message = "订单id不能为空")
    @ApiModelProperty(value = "订单ID",required = true,example = "1")
    private Long id;

    @NotNull(message = "分类ID不能为空")
    @ApiModelProperty(value = "分类ID",required = true,example = "1")
    private Long categoryId;

    @NotNull(message = "用户ID不能为空")
    @ApiModelProperty(value = "用户ID",required = true,example = "1")
    private Long userId;

    @NotNull(message = "场地ID不能为空")
    @ApiModelProperty(value = "场地ID",required = true,example = "1")
    private Long courtId;

    @NotNull(message = "日期不能为空")
    @ApiModelProperty(value = "开始时间",required = true,example = "2023-06-08")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date date;

    @NotNull(message = "时间段不能为空")
    @ApiModelProperty(value = "结束时间",required = true,example = "08:00-10:00")
    private String time;

    @NotNull(message = "支付金额不能为空")
    @ApiModelProperty(value = "支付金额",required = true,example = "80.00")
    private BigDecimal amount;

    @NotNull(message = "支付方式不能为空")
    @ApiModelProperty(value = "支付方式",required = true,example = "支付宝")
    private String paymentMethod;

//    @NotNull(message = "订单状态不能为空")
//    @ApiModelProperty(value = "订单状态",required = true,example = "已支付")
//    private Integer status;

    @NotNull(message = "提交时间不能为空")
    @ApiModelProperty(value = "提交时间",required = true,example = "2023-06-08 12:00:00")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime orderTime;

    @NotNull(message = "支付时间不能为空")
    @ApiModelProperty(value = "支付时间",required = true,example = "2023-06-08 12:00:00")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime paymentTime;

    @Range(min = 1,max = 100,message = "请输入1-100之间的数字")
    @ApiModelProperty(value = "排序序号",required = true,example = "56")
    private Integer sort;

}
